package org.tinygroup.uiml.metadata;

import java.util.ArrayList;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

/**
 * 组件类型定义
 * Created by luoguo on 2014/6/30.
 */
@XStreamAlias("component-type")
public class ComponentType {
    /**
     * 组件类型名称
     */
	@XStreamAsAttribute
    String type;
    /**
     * 组件所属平台，比如：可能是手机，WEB,PAD等等
     */
	@XStreamAsAttribute
    String platform;
    /**
     * 组件继承自组件类型，父类的所有属性都将被儿子拥有，所有可以放父亲的地方，也可以放儿子
     * 如果继承自多个组件类型，则用“,”号分隔
     */
	@XStreamAlias("extend-types")
	@XStreamAsAttribute
    String extendTypes;
    /**
     * 图标
     */
	@XStreamAsAttribute
    String icon;
    /**
     * 标题
     */
	@XStreamAsAttribute
    String title;
    /**
     * 短描述
     */
	@XStreamAlias("short-description")
    String shortDescription;
    /**
     * 描述
     */
	
    String description;
    /**
     * 属性类型定义列表
     */
    @XStreamImplicit
    private List<PropertyType> propertyTypes;

    public String getPlatform() {
    	if(platform==null){
    		platform="";
    	}
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }


    public List<PropertyType> getPropertyTypes() {
    	if(propertyTypes==null){
    		propertyTypes=new ArrayList<PropertyType>();
    	}
        return propertyTypes;
    }

    public void setPropertyTypes(List<PropertyType> propertyTypes) {
        this.propertyTypes = propertyTypes;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getExtendTypes() {
        return extendTypes;
    }

    public void setExtendTypes(String extendTypes) {
        this.extendTypes = extendTypes;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getShortDescription() {
        return shortDescription;
    }

    public void setShortDescription(String shortDescription) {
        this.shortDescription = shortDescription;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
